/*
 *********************************************************************************
 * Authors: narsil <ygk@ebidding.com.cn> 2014-06-27 49206C6F766520636F6E74726F6C *
 *********************************************************************************
 */
package com.example.demo.common.vo;

import com.example.demo.common.exception.EbsException;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;

public class EbsFile {

	/** 文件 */
	private File file;
	
	/** 文件id */
	private String fileId;
	
	/** 文件路径 */
	private String filePath; 
	
	/** 文件名字 */
	private String fileName;
	/**
	 * 文件所属人
	 */
	private Integer ownerUserId;
	
	public Integer getOwnerUserId() {
		return ownerUserId;
	}
	public void setOwnerUserId(Integer ownerUserId) {
		this.ownerUserId = ownerUserId;
	}
	public File getFile() {
		return file;
	}
	public void setFile(File file) {
		this.file = file;
	}
	public String getFileId() {
		return fileId;
	}
	public void setFileId(String fileId) {
		this.fileId = fileId;
	}
	public String getFilePath() {
		return filePath;
	}
	public void setFilePath(String filePath) {
		this.filePath = filePath;
	}
	
	public InputStream getInputStream() { 
		
		try {
			InputStream input = new FileInputStream(file);
			return input;
		} catch (FileNotFoundException e) {
			throw new EbsException(e);
		}		
	}
	 
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	} 
}
